package com.cd.service.dictionary.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cd.bean.Dictionary;
import com.cd.dao.DictionaryMapper;
import com.cd.service.dictionary.DictionaryService;

/**
 * 数据字典
 *@Author zhk
 *@Date 2017-12-22
 **/
@Service("DictionaryService")
public class DictionaryServiceImpl implements DictionaryService{

	@Autowired
	DictionaryMapper dictionaryMapper;
	
	@Override
	public void save(Dictionary dic) throws Exception {
		dictionaryMapper.save(dic);
	}

	@Override
	public void delete(Integer id) throws Exception {
		dictionaryMapper.delete(id);
	}

	@Override
	public void edit(Dictionary dic) throws Exception {
		dictionaryMapper.update(dic);
	}

	@Override
	public List<Dictionary> listAll() throws Exception {
		// TODO Auto-generated method stub
		return dictionaryMapper.queryByList();
	}

	@Override
	public Dictionary findById(Integer id) throws Exception {
		// TODO Auto-generated method stub
		return dictionaryMapper.query(id);
	}

	@Override
	public void deleteAll() throws Exception {
		
	}

	@Override
	public Integer size() throws Exception {
		// TODO Auto-generated method stub
		return dictionaryMapper.getCount();
	}

	@Override
	public List<Dictionary> listLimit() throws Exception {
		// TODO Auto-generated method stub
		return dictionaryMapper.list();
	}

	
}
